
const Koa = require('koa');
const fs = require('fs.promised');
const {resolve} = require('path');
const r = path => resolve(__dirname,path);
const app = new Koa();

const main =  async (ctx, next) => {
    ctx.response.type = 'html';
    ctx.response.body = await fs.readFile(r('../template/template.html', 'utf8'));
    next();
    console.log('end');
};
const main_1 = function (ctx, next) {

    ctx.response.body = 'Hello kkkkk';
};
app.use(main);
app.use(main_1);
app.listen(3006);
